

# from PIL import Image
#
# # 假设你有多个堆叠的图像，它们已经加载为Image对象列表
# images = [Image.open('image{}.png'.format(i)) for i in range(num_images)]
#
# # 获取参考图像的尺寸和要截取的相同区域的坐标
# ref_image = images[0]
# width, height = ref_image.size
# crop_box = (left, top, right, bottom)  # 定义相同区域的左上角和右下角坐标
#
# # 对于每个图像进行相同区域的裁剪
# cropped_images = [img.crop(crop_box) for img in images]
#
# # 可以进一步保存裁剪后的图像
# for i, cropped_img in enumerate(cropped_images):
#     cropped_img.save('cropped_image{}.png'.format(i))